<?php

function getProprioIdByGood($BDD_connexion,$id_good)
{
	
	$requestId = "SELECT id FROM personne, bien WHERE personne.id = bien.ref_proprio AND bien.id_bien = :id_bien";
	$prepareId = $BDD_connexion->prepare($requestId);
	$prepareId->bindValue(':id_bien',$id_good,PDO::PARAM_INT);
	$prepareId->execute();
	$id = $prepareId->fetch(PDO::FETCH_OBJ);
	
	return $id->id;
	
}

function isReallyUserGoodLocated($locations,$id_good)
{
	
	foreach ($locations as $location)
	{
		
		if (isset($location->bien->id_bien) && $location->bien->id_bien == $id_good)
		{
			return true;
		}
		
	}
	
	return false;
	
}

?>
